﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace DataEntity
{
    /// <summary>
    /// 添加首吃水
    /// </summary>
    public class ChiShuiEntity : INotifyPropertyChanged
    {
        private int _ID;

        public int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }

        private int _ProjectID;
        public int ProjectID
        {
            get { return _ProjectID; }
            set { _ProjectID = value; }
        }

        private string _ExperimentType;
        public string ExperimentType
        {
            get { return _ExperimentType; }
            set { _ExperimentType = value; }
        }
        

        private float _ShouChiShui;
        public float ShouChiShui
        {
            get { return _ShouChiShui; }
            set
            {
                if (_ShouChiShui != value)
                {
                    _ShouChiShui = value;
                    this.OnPropertyChanged("ShouChiShui");
                }
            }
        }

        private float _WeiChiShui;
        public float WeiChiShui
        {
            get { return _WeiChiShui; }
            set
            {
                if (_WeiChiShui != value)
                {
                    _WeiChiShui = value;
                    this.OnPropertyChanged("WeiChiShui");
                }
            }
        }

        private string _DSC;
        public string DSC
        {
            get { return _DSC; }
            set
            {
                if (_DSC != value)
                {
                    _DSC = value;
                    this.OnPropertyChanged("DSC");
                }
            }
        }             

        #region PropertyChanged事件
        public event PropertyChangedEventHandler PropertyChanged;

        public void OnPropertyChanged(string PropName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(PropName));
            }
        }
        #endregion

        public override string ToString()
        {
            return "首池水:" + ShouChiShui + ";" + "尾池水:" + WeiChiShui + ";备注:" + DSC+";";
        }

        public string Text
        {
            get { return ToString(); }
        }

        public override bool Equals(object obj)
        {
            ChiShuiEntity entity = obj as ChiShuiEntity;
            if (entity != null && entity.ShouChiShui == this.ShouChiShui
                && entity.WeiChiShui == this.WeiChiShui && entity.Text == this.Text)
            {
                return true;
            }
            else
            {
                return false;
            }
            
        }
    }
}
